﻿#include <stdio.h>

//main15：for循环案例：水仙花
int main15(void)
{
	for (int i = 100; i < 1000; i++)
	{
		//1.将一个三位数拆解成个位，十位，百位；
		int a = 0, b = 0, c = 0;
		//2.百位；
		a = i / 100;
		//3.十位；878/10=87%10=7
		b = i / 10 % 10;
		//4.个位；
		c = i % 10;
		if (a * a * a + b * b * b + c * c * c == i)
		{
			printf("5.输出此水仙花数index为：%d\n", i);//153 370 371 407
		}
	}
	return 0;
}